#!/bin/bash

FRAPPE_VERSION=${1}

ERPNEXT_VERSION=${2}

## 1. prepare images
docker pull frappe/erpnext-worker:${FRAPPE_VERSION}
docker tag frappe/erpnext-worker:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-worker:${FRAPPE_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-worker:${FRAPPE_VERSION}
docker tag frappe/erpnext-worker:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-worker:${ERPNEXT_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-worker:${ERPNEXT_VERSION}

docker pull frappe/erpnext-nginx:${FRAPPE_VERSION}
docker tag frappe/erpnext-nginx:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-nginx:${FRAPPE_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-nginx:${FRAPPE_VERSION}
docker tag frappe/erpnext-nginx:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-nginx:${ERPNEXT_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-nginx:${ERPNEXT_VERSION}

docker pull frappe/frappe-socketio:${FRAPPE_VERSION}
docker tag frappe/frappe-socketio:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-socketio:${FRAPPE_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-socketio:${FRAPPE_VERSION}
docker tag frappe/frappe-socketio:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-socketio:${ERPNEXT_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-socketio:${ERPNEXT_VERSION}

docker pull frappe/frappe-nginx:${FRAPPE_VERSION}
docker tag frappe/frappe-nginx:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-nginx:${FRAPPE_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-nginx:${FRAPPE_VERSION}
docker tag frappe/frappe-nginx:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-nginx:${ERPNEXT_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-nginx:${ERPNEXT_VERSION}

docker pull frappe/frappe-worker:${FRAPPE_VERSION}
docker tag frappe/frappe-worker:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-worker:${FRAPPE_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-worker:${FRAPPE_VERSION}
docker tag frappe/frappe-worker:${FRAPPE_VERSION} registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-worker:${ERPNEXT_VERSION}
docker push registry.cn-shanghai.aliyuncs.com/xdicloud/frappe-worker:${ERPNEXT_VERSION}